#pragma once

#include <QObject>

namespace framework {

  template<class T>
  T GetPresenterView(QObject * pPresenter_)
  {
    return qobject_cast<T>(qVariantValue<QObject *>(pPresenter_->property("mvp::view")));
  }

  template<class T>
  T GetPresenterModel(QObject * pPresenter_)
  {
    return qobject_cast<T>(qVariantValue<QObject *>(pPresenter_->property("mvp::model")));
  }

  template<class T>
  T GetViewPresenter(QObject * pView_)
  {
    return qobject_cast<T>(qVariantValue<QObject *>(pView_->property("mvp::presenter")));
  }

} // namespace framework {